// ofstream

#include <fstream>
#include <iostream>
using namespace std;


int main( void ) {
	ofstream ofs( "./noformat", ios::out );
	if( !ofs ) {
		cerr << "ofs statue has some err ----  fail to open";
	}
	for( char c=' ' ;c <= '~'; c++ ) {
		ofs.put( c ).flush( );
	}

	ofs.close( );


	ifstream ifs( "./noformat", ios::in );
	if( !ifs ){
		cerr << "ifs fail to read" << endl;
	}
	char c;
	while( 1 ) {
		ifs.get( c );
		if( !ifs ){
			break;
		} else{
			cout << c;
		}
	}
	cout << endl;

	ifs.clear( );
	ifs.seekg( 0, ios::beg );
	while( 1 ) {
		c = ifs.get( );
		if( c == EOF ) {
			break;
		} else {
			cout << c;
		}
	}
	cout << endl;

	ifs.close( );
	

	return 0;
}

